package cn.sh.yhk.mapper;

import cn.sh.yhk.model.InviteBids;
import cn.sh.yhk.model.InviteBidsExample;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
@CacheNamespace
public interface InviteBidsMapper {
    @SelectProvider(type=InviteBidsSqlProvider.class, method="countByExample")
    long countByExample(InviteBidsExample example);

    @DeleteProvider(type=InviteBidsSqlProvider.class, method="deleteByExample")
    int deleteByExample(InviteBidsExample example);

    @Delete({
        "delete from invite_bids",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into invite_bids (id, number_id, ",
        "car_model, end_time, ",
        "item_name, invite_id, ",
        "car_model_number, car_explain, ",
        "reggion, privince, ",
        "city, bugget, type, ",
        "invite_bids_brief, url, ",
        "other, release_time, ",
        "remarks, firm, latitude, ",
        "longitude, state, ",
        "create_time, modify_time, ",
        "invite_bids_detail)",
        "values (#{id,jdbcType=INTEGER}, #{numberId,jdbcType=VARCHAR}, ",
        "#{carModel,jdbcType=VARCHAR}, #{endTime,jdbcType=TIMESTAMP}, ",
        "#{itemName,jdbcType=VARCHAR}, #{inviteId,jdbcType=VARCHAR}, ",
        "#{carModelNumber,jdbcType=VARCHAR}, #{carExplain,jdbcType=VARCHAR}, ",
        "#{reggion,jdbcType=VARCHAR}, #{privince,jdbcType=VARCHAR}, ",
        "#{city,jdbcType=VARCHAR}, #{bugget,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, ",
        "#{inviteBidsBrief,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, ",
        "#{other,jdbcType=VARCHAR}, #{releaseTime,jdbcType=VARCHAR}, ",
        "#{remarks,jdbcType=VARCHAR}, #{firm,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, ",
        "#{longitude,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, ",
        "#{inviteBidsDetail,jdbcType=LONGVARCHAR})"
    })
    int insert(InviteBids record);

    @InsertProvider(type=InviteBidsSqlProvider.class, method="insertSelective")
    int insertSelective(InviteBids record);

    @SelectProvider(type=InviteBidsSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="number_id", property="numberId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model", property="carModel", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="item_name", property="itemName", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_id", property="inviteId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model_number", property="carModelNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_explain", property="carExplain", jdbcType=JdbcType.VARCHAR),
        @Result(column="reggion", property="reggion", jdbcType=JdbcType.VARCHAR),
        @Result(column="privince", property="privince", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="bugget", property="bugget", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_bids_brief", property="inviteBidsBrief", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="other", property="other", jdbcType=JdbcType.VARCHAR),
        @Result(column="release_time", property="releaseTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="firm", property="firm", jdbcType=JdbcType.VARCHAR),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="invite_bids_detail", property="inviteBidsDetail", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<InviteBids> selectByExampleWithBLOBs(InviteBidsExample example);

    @SelectProvider(type=InviteBidsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="number_id", property="numberId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model", property="carModel", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="item_name", property="itemName", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_id", property="inviteId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model_number", property="carModelNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_explain", property="carExplain", jdbcType=JdbcType.VARCHAR),
        @Result(column="reggion", property="reggion", jdbcType=JdbcType.VARCHAR),
        @Result(column="privince", property="privince", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="bugget", property="bugget", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_bids_brief", property="inviteBidsBrief", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="other", property="other", jdbcType=JdbcType.VARCHAR),
        @Result(column="release_time", property="releaseTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="firm", property="firm", jdbcType=JdbcType.VARCHAR),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<InviteBids> selectByExample(InviteBidsExample example);

    @Select({
        "select",
        "id, number_id, car_model, end_time, item_name, invite_id, car_model_number, ",
        "car_explain, reggion, privince, city, bugget, type, invite_bids_brief, url, ",
        "other, release_time, remarks, firm, latitude, longitude, state, create_time, ",
        "modify_time, invite_bids_detail",
        "from invite_bids",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="number_id", property="numberId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model", property="carModel", jdbcType=JdbcType.VARCHAR),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="item_name", property="itemName", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_id", property="inviteId", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_model_number", property="carModelNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="car_explain", property="carExplain", jdbcType=JdbcType.VARCHAR),
        @Result(column="reggion", property="reggion", jdbcType=JdbcType.VARCHAR),
        @Result(column="privince", property="privince", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="bugget", property="bugget", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="invite_bids_brief", property="inviteBidsBrief", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="other", property="other", jdbcType=JdbcType.VARCHAR),
        @Result(column="release_time", property="releaseTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="firm", property="firm", jdbcType=JdbcType.VARCHAR),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="invite_bids_detail", property="inviteBidsDetail", jdbcType=JdbcType.LONGVARCHAR)
    })
    InviteBids selectByPrimaryKey(Integer id);

    @UpdateProvider(type=InviteBidsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") InviteBids record, @Param("example") InviteBidsExample example);

    @UpdateProvider(type=InviteBidsSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") InviteBids record, @Param("example") InviteBidsExample example);

    @UpdateProvider(type=InviteBidsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") InviteBids record, @Param("example") InviteBidsExample example);

    @UpdateProvider(type=InviteBidsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(InviteBids record);

    @Update({
        "update invite_bids",
        "set number_id = #{numberId,jdbcType=VARCHAR},",
          "car_model = #{carModel,jdbcType=VARCHAR},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "item_name = #{itemName,jdbcType=VARCHAR},",
          "invite_id = #{inviteId,jdbcType=VARCHAR},",
          "car_model_number = #{carModelNumber,jdbcType=VARCHAR},",
          "car_explain = #{carExplain,jdbcType=VARCHAR},",
          "reggion = #{reggion,jdbcType=VARCHAR},",
          "privince = #{privince,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR},",
          "bugget = #{bugget,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=VARCHAR},",
          "invite_bids_brief = #{inviteBidsBrief,jdbcType=VARCHAR},",
          "url = #{url,jdbcType=VARCHAR},",
          "other = #{other,jdbcType=VARCHAR},",
          "release_time = #{releaseTime,jdbcType=VARCHAR},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "firm = #{firm,jdbcType=VARCHAR},",
          "latitude = #{latitude,jdbcType=VARCHAR},",
          "longitude = #{longitude,jdbcType=VARCHAR},",
          "state = #{state,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "modify_time = #{modifyTime,jdbcType=TIMESTAMP},",
          "invite_bids_detail = #{inviteBidsDetail,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(InviteBids record);

    @Update({
        "update invite_bids",
        "set number_id = #{numberId,jdbcType=VARCHAR},",
          "car_model = #{carModel,jdbcType=VARCHAR},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "item_name = #{itemName,jdbcType=VARCHAR},",
          "invite_id = #{inviteId,jdbcType=VARCHAR},",
          "car_model_number = #{carModelNumber,jdbcType=VARCHAR},",
          "car_explain = #{carExplain,jdbcType=VARCHAR},",
          "reggion = #{reggion,jdbcType=VARCHAR},",
          "privince = #{privince,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR},",
          "bugget = #{bugget,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=VARCHAR},",
          "invite_bids_brief = #{inviteBidsBrief,jdbcType=VARCHAR},",
          "url = #{url,jdbcType=VARCHAR},",
          "other = #{other,jdbcType=VARCHAR},",
          "release_time = #{releaseTime,jdbcType=VARCHAR},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "firm = #{firm,jdbcType=VARCHAR},",
          "latitude = #{latitude,jdbcType=VARCHAR},",
          "longitude = #{longitude,jdbcType=VARCHAR},",
          "state = #{state,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "modify_time = #{modifyTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(InviteBids record);
}